package com.shuaitao.newsystem.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 *
 * @TableName comments
 */
@TableName(value ="comments")
@Data
public class Comments implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer cid;

    /**
     *
     */
    private Integer cnid;

    /**
     *
     */
    private String ccontent;

    /**
     *
     */
    private Date cdate;

    /**
     *
     */
    private String cip;

    /**
     *
     */
    private String cauthor;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Comments other = (Comments) that;
        return (this.getCid() == null ? other.getCid() == null : this.getCid().equals(other.getCid()))
            && (this.getCnid() == null ? other.getCnid() == null : this.getCnid().equals(other.getCnid()))
            && (this.getCcontent() == null ? other.getCcontent() == null : this.getCcontent().equals(other.getCcontent()))
            && (this.getCdate() == null ? other.getCdate() == null : this.getCdate().equals(other.getCdate()))
            && (this.getCip() == null ? other.getCip() == null : this.getCip().equals(other.getCip()))
            && (this.getCauthor() == null ? other.getCauthor() == null : this.getCauthor().equals(other.getCauthor()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCid() == null) ? 0 : getCid().hashCode());
        result = prime * result + ((getCnid() == null) ? 0 : getCnid().hashCode());
        result = prime * result + ((getCcontent() == null) ? 0 : getCcontent().hashCode());
        result = prime * result + ((getCdate() == null) ? 0 : getCdate().hashCode());
        result = prime * result + ((getCip() == null) ? 0 : getCip().hashCode());
        result = prime * result + ((getCauthor() == null) ? 0 : getCauthor().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", cid=").append(cid);
        sb.append(", cnid=").append(cnid);
        sb.append(", ccontent=").append(ccontent);
        sb.append(", cdate=").append(cdate);
        sb.append(", cip=").append(cip);
        sb.append(", cauthor=").append(cauthor);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
